﻿using System;
using System.Collections.Generic;

namespace Jarvis.Server.Location
{
    public interface ILocationProvider
    {
        /// <summary>
        /// Location object referring to the location the agent is currently
        /// in (not stored in the db of known locations) all fields are not populated
        /// </summary>
        Domain.Location CurrentLocation { get; }
        /// <summary>
        /// Location object referring to the best fitting location present in the db.
        /// </summary>
        Domain.Location ComputedLocation { get; }


        IList<Domain.Location> KnownLocations { get; }
        /// <summary>
        /// Stores the location object in the db of known locations
        /// </summary>
        /// <param name="location">location object to store, required fields should be populated</param>
        void StoreAsKnownLocation(Domain.Location location);


        void RemoveLocation(Domain.Location location);

        void UpdateLocation(Domain.Location location);

        event EventHandler<LocationEventArgs> CurrentLocationChanged;
    }


    public class LocationEventArgs : EventArgs
    {
        public Domain.Location Location { get; set; }

        public LocationEventArgs(Domain.Location location)
        {
            Location = location;
        }
    }
}
